home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Presentations
/
Presentations ’93
/
Macintosh as Internet Server ƒ
/
inetd
/
in.rshd
/
in.rcp
/
rcp.h
< prev
next >
Wrap
Text File
|
1993-04-08
|
2KB
|
89 lines
//---------------------------------------------------------------------
//
// Copyright © 1992 David Peterson.
// All rights reserved.
//
// Permission to use, copy, modify, and distribute this software for
// any purpose and without fee is hereby granted, provided that the
// above copyright notice appear in all copies and that both that
// copyright notice and this permission notice appear in supporting
// documentation.
//
//---------------------------------------------------------------------
#ifndef __DAEMONAPP__
#include <DaemonApp.h>
#endif
#ifndef __MACTCPCOMMONTYPES__
#include <MacTCPCommonTypes.h>
#endif
class Rcp : public DaemonApp {
typedef DaemonApp Inherited;
typedef void (*rcpProc)(Rcp* it);
public:
char fCommandString[256];
StreamPtr fStreamPtr;
short fRefNum;
Ptr fBuffer;
int fBufLen;
int fFileSize;
int fAmtLeft;
Boolean fWorkingOnAFile;
short fFileIORefNum;
Str255 fFileName;
Boolean fTargetShouldBeDir;
Boolean fTargetIsDir;
Boolean fIAmRecursive;
Boolean fToFlag;
Boolean fFromFlag;
short fVRefNum;
long fDirID;
rcpProc fMore;
rcpProc fFile;
Rcp();
virtual ~Rcp();
virtual void InstallAEHandlers();
virtual void Initialize();
virtual void DoNull();
void GetMore();
void NewFile();
void ReadMore();
void OpenNext();
void VerifyAndSetDir(char* test);
void ParseCommandString();
void TakeControlOfStream();
Boolean CreateFile(Str255 name, char type);
void CloseFile();
void WriteToFile(char* buf, short len);
void UpDir();
void SendOK();
void SendError(char* msg);
};
extern "C" {
pascal OSErr AEStreamHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
pascal void Notify( StreamPtr tcpStream,
unsigned short eventCode,
Ptr userDataPtr,
unsigned short termReason,
struct ICMPReport* icmpMessage );
};